﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
using Utility;
using Data;

namespace Website.Student
{
    public partial class Show_FAQ : System.Web.UI.UserControl
    {
        Tbl_FaqBus Faq_Bus = new Tbl_FaqBus();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                loadData();
            }
        }
        public void loadData()
        {
            GridView1.DataSource = Faq_Bus.getListFaq();
            GridView1.DataBind();
        }
        protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            txtTitle.Text = WebHelper.GetValueGridView(GridView1, 2, e);
            txtQuestion.Text = WebHelper.GetValueGridView(GridView1, 3, e);
            txtAnswer.Text = WebHelper.GetValueGridView(GridView1, 4, e);
        }
    }
}